package com.mtsmda.chapter1;

import java.util.ArrayList;
import java.util.List;

public class VarArgClass {
	
	private List<String> list = new ArrayList<>();
	
	public void addToListDates(String ...strings){
		if(strings.length != 0){
			for(int i = 0; i < strings.length; i++){
				list.add(strings[i]);
			}
		}
	}
	
	public void listDatesPrint(){
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}
	}
	
	public static void main(String[] args) {
		VarArgClass varArgClass = new VarArgClass();
		varArgClass.addToListDates("Dmitrii", "Mynzat", "Spartak", "Barcelona", "Milan");
		varArgClass.listDatesPrint();
		
	}
	
}